import time

import allure
from page_object.page_roncoo_pay_login import PageLogin
from page_element.el_Roncoo import *
import logging



class SearchSettlementUser(PageLogin):
    """首页搜索商品后退出登录"""

    def page_search_settlement_user(self,info):
        # 前置条件：已登录
        self.page_login('admin', '123456')

        with allure.step("点击结算管理"):
            self.click(settle_manage.settlement_manage)
        with allure.step("点击结算记录管理"):
            self.click(settle_manage.settlement_records_manage)
        with allure.step(f"输入框输入用户名:{info}"):
            self.send_keys(settle_manage.username_inp, info)
        with allure.step("点击搜索按钮"):
            self.click(settle_manage.search_use_btn)
        # 断言
        with allure.step("验证搜索出来的状态"):
            dy = self.text(settle_manage.dy_use_text)
            assert '刘豆' == str(dy), '断言失败(验证失败)'
            print(f'断言的内容:刘豆 == {dy}')
            logging.info(f'断言的内容:刘豆 == {dy}')





